package com.ruoyi.pv.domain;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.doudou.core.container.ListUtil;
import lombok.*;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 实训预约对象 pv_appoint
 *
 * @author zzx
 * @date 2023-04-22
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@ToString
public class PvAppoint extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Long id;

    /**
     * 项目
     */
    @Excel(name = "项目")
    private String project;

    /**
     * 场地编号
     */
    @Excel(name = "场地编号")
    private Long roomId;
    private String roomName;

    /**
     * 机构编号
     */
    @Excel(name = "机构编号")
    private Long deptId;

    /**
     * 实训项目编号
     */
    @Excel(name = "实训项目编号")
    private Long trainingprogramId;
    private String trainingProgramName;

    /**
     * 班级编号
     */
    @Excel(name = "班级编号")
    private Long classId;

    /**
     * 教师编号
     */
    @Excel(name = "教师")
    private String teacher;
    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date beginDate;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endDate;
    private List<String> dateRange = ListUtil.list(true);

    /**
     * 容量
     */
    @Excel(name = "容量")
    private Integer quantity;

    /**
     * 提前预约天数
     */
    @Excel(name = "提前预约天数")
    private Integer forwardDate;

    /**
     * 预留字段1
     */
    private String reservedOne;

    /**
     * 预留字段2
     */
    private String reservedTwo;

    /** 预约时段表信息 */
    private List<PvAppointTime> pvAppointTimeList;

    public Integer minusForwardDate(){
        return this.forwardDate - this.forwardDate * 2;
    }

    public void addRange(String date){
        this.dateRange.add(date);
    }

}
